package GameServer.util;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * Created by gzhd on 2017/11/29.
 */
public class ExecutorPool {
    public static ExecutorService handleThreadPool = null;

    public static void InitThreadsExecutor(){
        handleThreadPool = Executors.newCachedThreadPool();
    }

    public static void execute(Runnable runnable){
        handleThreadPool.execute(runnable);
    }

    public static void shutdown(){
        if (!handleThreadPool.isShutdown()) {
            handleThreadPool.shutdown();
        }
    }

}